<template>
  <div class="flex justify-center">
    <div class="p-4 mt-5 mx-1 bg-white rounded" style="width: 500px;">
      <div class="mb-2 text-center">
        <el-input
            v-model="keyword"
            clearable
            class="inline-input w-50"
            placeholder="请输入检索词"
            style="width: 80%;"
            @keyup.enter="handleSearch"
            size="large"
        >
        </el-input>
        <el-button class="ml-1" @click="handleSearch" size="large" type="primary">搜索</el-button>
      </div>
    </div>
  </div>
</template>

<script setup>
import {ref, onMounted, getCurrentInstance} from 'vue'
const keyword = ref('')

const {proxy} = getCurrentInstance()
const handleSearch = ()=>{
  proxy.$router.push('/search?keyword=' + keyword.value)
}
</script>

<style scoped>

</style>
